package com.abaaba.project2.controller;

import com.abaaba.project2.bean.bo.MallConfigBO;
import com.abaaba.project2.bean.bo.MallConfigExpressBO;
import com.abaaba.project2.bean.vo.AdminConfigExpressVo;
import com.abaaba.project2.bean.vo.AdminConfigVO;
import com.abaaba.project2.bean.vo.BaseRespVo;
import com.abaaba.project2.service.AdminConfigExpressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author Hedgehog
 * @Date 2021/6/6 21:59
 * @Version 1.0
 */
@RestController
@RequestMapping("admin/config")
public class AdminConfigExpressController {

    @Autowired
    AdminConfigExpressService adminConfigExpressService;

    @RequestMapping(value = "express",method = RequestMethod.GET)
    public BaseRespVo expressGet(){

        AdminConfigExpressVo adminConfigExpressVo=adminConfigExpressService.selectConfigExpress();


        return BaseRespVo.ok(adminConfigExpressVo);
    }

    @RequestMapping(value = "express",method = RequestMethod.POST)
    public BaseRespVo expressPost(@RequestBody MallConfigExpressBO mallConfigExpressBO){


        adminConfigExpressService.updateExpress(mallConfigExpressBO);

        return BaseRespVo.ok();
    }

}
